from nornir import InitNornir
from nornir_netmiko import netmiko_send_command
from nornir_napalm.plugins.tasks import napalm_get

from nornir_utils.plugins.functions import print_result

nr = InitNornir(config_file='config.yaml')

# result = nr.run(napalm_get, getters=["facts", "interfaces"])
# result = nr.run(task=napalm_get, getters=['lldp_neighbors'])


def get_host_data(task):
    """Nornir Task for data collection on target hosts."""
    task.run(
        task=napalm_get,
        getters=['facts', 'lldp_neighbors_detail']
    )


get_host_data_result = nr.run(get_host_data)

print_result(result)
